<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class ID3v2</title>
			<link rel="stylesheet" href="../../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class ID3v2</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">This class represents a file containing ID3v2 headers as described in  <a href="http://www.id3.org/id3v2.4.0-structure">ID3v2 structure document</a>.</p>
<p class="description"><p>ID3v2 is a general tagging format for audio, which makes it possible to store  meta data about the audio inside the audio file itself. The ID3 tag is mainly  targeted at files encoded with MPEG-1/2 layer I, MPEG-1/2 layer II, MPEG-1/2  layer III and MPEG-2.5, but may work with other types of encoded audio or as  a stand alone format for audio meta data.</p><p>ID3v2 is designed to be as flexible and expandable as possible to meet new  meta information needs that might arise. To achieve that ID3v2 is constructed  as a container for several information blocks, called frames, whose format  need not be known to the software that encounters them. Each frame has an  unique and predefined identifier which allows software to skip unknown  frames.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Ryan Butterfield &lt;<a href="mailto:buttza@gmail.com">buttza@gmail.com</a>&gt;</li>
				<li><span class="field">author:</span> Sven Vollbehr &lt;<a href="mailto:svollbehr@gmail.com">svollbehr@gmail.com</a>&gt;</li>
				<li><span class="field">version:</span> $Rev: 131 $</li>
				<li><span class="field">copyright:</span> Copyright (c) 2008 The PHP Reader Project Workgroup</li>
				<li><span class="field">license:</span> <a href="http://code.google.com/p/php-reader/wiki/License">New BSD License</a></li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_ID3v2.php.html">/ID3v2.php</a> (line <span class="field">71</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																																																																												
												<div class="method-definition">
											<span class="method-result">ID3v2</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											([<span class="var-type">string|<a href="../../php-reader/Reader.html">Reader</a></span>&nbsp;<span class="var-name">$filename</span> = <span class="var-default">false</span>], [<span class="var-type">Array</span>&nbsp;<span class="var-name">$options</span> = <span class="var-default">array()</span>])
									</div>
																<div class="method-definition">
											<span class="method-result"><a href="../../php-reader/ID3/ID3_Frame.html">ID3_Frame</a></span>
										<a href="#addFrame" title="details" class="method-name">addFrame</a>
											(<span class="var-type"><a href="../../php-reader/ID3/ID3_Frame.html">ID3_Frame</a></span>&nbsp;<span class="var-name">$frame</span>)
									</div>
																<div class="method-definition">
											<span class="method-result"><a href="../../php-reader/ID3/ID3_ExtendedHeader.html">ID3_ExtendedHeader</a>|false</span>
										<a href="#getExtendedHeader" title="details" class="method-name">getExtendedHeader</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result"><a href="../../php-reader/ID3/ID3_Header.html">ID3_Header</a>|false</span>
										<a href="#getFooter" title="details" class="method-name">getFooter</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">Array</span>
										<a href="#getFrames" title="details" class="method-name">getFrames</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">Array</span>
										<a href="#getFramesByIdentifier" title="details" class="method-name">getFramesByIdentifier</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$identifier</span>)
									</div>
																<div class="method-definition">
											<span class="method-result"><a href="../../php-reader/ID3/ID3_Header.html">ID3_Header</a></span>
										<a href="#getHeader" title="details" class="method-name">getHeader</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#hasExtendedHeader" title="details" class="method-name">hasExtendedHeader</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#hasFooter" title="details" class="method-name">hasFooter</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#hasFrame" title="details" class="method-name">hasFrame</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$identifier</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#setExtendedHeader" title="details" class="method-name">setExtendedHeader</a>
											(<span class="var-type"><a href="../../php-reader/ID3/ID3_ExtendedHeader.html">ID3_ExtendedHeader</a></span>&nbsp;<span class="var-name">$extendedHeader</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#setFooter" title="details" class="method-name">setFooter</a>
											(<span class="var-type">boolean</span>&nbsp;<span class="var-name">$useFooter</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#write" title="details" class="method-name">write</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span> = <span class="var-default">false</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">mixed</span>
										<a href="#__get" title="details" class="method-name">__get</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#__isset" title="details" class="method-name">__isset</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#__toString" title="details" class="method-name">__toString</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#__unset" title="details" class="method-name">__unset</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>)
									</div>
								</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>

<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">117</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructs the ID3v2 class with given file and options. The options array  may also be given as the only parameter.</p>
<p class="description"><p>The following options are currently recognized: <ul><li>encoding -- Indicates the encoding that all the texts are presented
     with. By default this is set to ID3_Encoding::UTF8. See the
     documentation of the <a href="../../php-reader/ID3/ID3_Encoding.html">ID3_Encoding</a> interface for accepted
     values. Conversions are carried out using iconv.</li><li>version -- The ID3v2 tag version to use in write operation. This option
     is automatically set when a tag is read from a file and defaults to
     version 4.0 for tag write.</li><li>readonly -- Indicates that the tag is read from a temporary file or
     another source it cannot be written back to. The tag can, however,
     still be written to another file.</li></ul></p></p>
	<ul class="tags">
				<li><span class="field">todo:</span> Only limited subset of flags are processed.</li>
				<li><span class="field">todo:</span> Utilize the SEEK frame and search for a footer to find the tag</li>
				<li><span class="field">todo:</span> Utilize the LINK frame to fetch frames from other sources</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">ID3v2</span>
		<span class="method-name">
			__construct
		</span>
					([<span class="var-type">string|<a href="../../php-reader/Reader.html">Reader</a></span>&nbsp;<span class="var-name">$filename</span> = <span class="var-default">false</span>], [<span class="var-type">Array</span>&nbsp;<span class="var-name">$options</span> = <span class="var-default">array()</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string|<a href="../../php-reader/Reader.html">Reader</a></span>
				<span class="var-name">$filename</span><span class="var-description">: The path to the file, file descriptor of an                                 opened file, or <a href="../../php-reader/Reader.html">Reader</a> instance.</span>			</li>
					<li>
				<span class="var-type">Array</span>
				<span class="var-name">$options</span><span class="var-description">: The options array.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodaddFrame" id="addFrame"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">addFrame</span> (line <span class="line-number">295</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Adds a new frame to the tag and returns it.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../../php-reader/ID3/ID3_Frame.html">ID3_Frame</a></span>
		<span class="method-name">
			addFrame
		</span>
					(<span class="var-type"><a href="../../php-reader/ID3/ID3_Frame.html">ID3_Frame</a></span>&nbsp;<span class="var-name">$frame</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"><a href="../../php-reader/ID3/ID3_Frame.html">ID3_Frame</a></span>
				<span class="var-name">$frame</span><span class="var-description">: The frame to add.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetExtendedHeader" id="getExtendedHeader"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getExtendedHeader</span> (line <span class="line-number">221</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the extended header object if present, or <var>false</var>  otherwise.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../../php-reader/ID3/ID3_ExtendedHeader.html">ID3_ExtendedHeader</a>|false</span>
		<span class="method-name">
			getExtendedHeader
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetFooter" id="getFooter"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getFooter</span> (line <span class="line-number">319</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the footer object if present, or <var>false</var> otherwise.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../../php-reader/ID3/ID3_Header.html">ID3_Header</a>|false</span>
		<span class="method-name">
			getFooter
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetFrames" id="getFrames"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getFrames</span> (line <span class="line-number">261</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns all the frames the tag contains as an associate array. The frame  identifiers work as keys having an array of frames as associated value.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Array</span>
		<span class="method-name">
			getFrames
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetFramesByIdentifier" id="getFramesByIdentifier"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getFramesByIdentifier</span> (line <span class="line-number">277</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns an array of frames matching the given identifier or an empty array  if no frames matched the identifier.</p>
<p class="description"><p>The identifier may contain wildcard characters &quot;*&quot; and &quot;?&quot;. The asterisk  matches against zero or more characters, and the question mark matches any  single character.</p><p>Please note that one may also use the shorthand $obj-&gt;identifier to access  the first frame with the identifier given. Wildcards cannot be used with  the shorthand.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Array</span>
		<span class="method-name">
			getFramesByIdentifier
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$identifier</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$identifier</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetHeader" id="getHeader"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getHeader</span> (line <span class="line-number">201</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the header object.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../../php-reader/ID3/ID3_Header.html">ID3_Header</a></span>
		<span class="method-name">
			getHeader
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodhasExtendedHeader" id="hasExtendedHeader"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">hasExtendedHeader</span> (line <span class="line-number">209</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Checks whether there is an extended header present in the tag. Returns  <var>true</var> if the header is present, <var>false</var> otherwise.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			hasExtendedHeader
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodhasFooter" id="hasFooter"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">hasFooter</span> (line <span class="line-number">309</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Checks whether there is a footer present in the tag. Returns  <var>true</var> if the footer is present, <var>false</var> otherwise.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			hasFooter
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodhasFrame" id="hasFrame"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">hasFrame</span> (line <span class="line-number">250</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Checks whether there is a frame given as an argument defined in the tag.</p>
<p class="description"><p>Returns <var>true</var> if one ore more frames are present,  <var>false</var> otherwise.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			hasFrame
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$identifier</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$identifier</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetExtendedHeader" id="setExtendedHeader"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">setExtendedHeader</span> (line <span class="line-number">233</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets the extended header object.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setExtendedHeader
		</span>
					(<span class="var-type"><a href="../../php-reader/ID3/ID3_ExtendedHeader.html">ID3_ExtendedHeader</a></span>&nbsp;<span class="var-name">$extendedHeader</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"><a href="../../php-reader/ID3/ID3_ExtendedHeader.html">ID3_ExtendedHeader</a></span>
				<span class="var-name">$extendedHeader</span><span class="var-description">: The header object</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetFooter" id="setFooter"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">setFooter</span> (line <span class="line-number">331</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets whether the tag should have a footer defined.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setFooter
		</span>
					(<span class="var-type">boolean</span>&nbsp;<span class="var-name">$useFooter</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">boolean</span>
				<span class="var-name">$useFooter</span><span class="var-description">: Whether the tag should have a footer</span>			</li>
				</ul>
		
			
	</div>
<a name="methodwrite" id="write"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">write</span> (line <span class="line-number">360</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Writes the possibly altered ID3v2 tag back to the file where it was read.</p>
<p class="description"><p>If the class was constructed without a file name, one can be provided here  as an argument. Regardless, the write operation will override previous  tag information, if found.</p><p>If write is called without setting any frames to the tag, the tag is  removed from the file.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			write
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$filename</span><span class="var-description">: The optional path to the file.</span>			</li>
				</ul>
		
			
	</div>
<a name="method__get" id="__get"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">__get</span> (line <span class="line-number">409</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Magic function so that $obj-&gt;value will work. The method will attempt to  return the first frame that matches the identifier.</p>
<p class="description"><p>If there is no frame or field with given name, the method will attempt to  create a frame with given identifier.</p><p>If none of these work, an exception is thrown.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">mixed</span>
		<span class="method-name">
			__get
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$name</span><span class="var-description">: The frame or field name.</span>			</li>
				</ul>
		
			
	</div>
<a name="method__isset" id="__isset"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">__isset</span> (line <span class="line-number">429</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Magic function so that isset($obj-&gt;value) will work. This method checks  whether the frame matching the identifier exists.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			__isset
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$name</span><span class="var-description">: The frame identifier.</span>			</li>
				</ul>
		
			
	</div>
<a name="method__toString" id="__toString"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">__toString</span> (line <span class="line-number">447</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the tag raw data.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			__toString
		</span>
				()
			</div>
	
		
			
	</div>
<a name="method__unset" id="__unset"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">__unset</span> (line <span class="line-number">440</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Magic function so that unset($obj-&gt;value) will work. This method removes  all the frames matching the identifier.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			__unset
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$name</span><span class="var-description">: The frame identifier.</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Thu, 01 Jan 2009 14:59:21 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</div></body>
</html>